import request from "@/utils/request";

export function get(dictName) {
  const params = {
    dictName,
    page: 0,
    size: 9999
  };
  return request({
    url: "rest/api/dictDetail",
    method: "get",
    params
  });
}

export function getDictMap(dictName) {
  const params = {
    dictName,
    page: 0,
    size: 9999
  };
  return request({
    url: "rest/api/dictDetail/map",
    method: "get",
    params
  });
}

export function add(data) {
  return request({
    url: "rest/api/dictDetail",
    method: "post",
    data
  });
}

export function del(id) {
  return request({
    url: "rest/api/dictDetail/del/" + id,
    method: "get"
  });
}

export function edit(data) {
  return request({
    url: "rest/api/dictDetail/update",
    method: "post",
    data
  });
}

export default { add, edit, del };
